package com.shopping_assistant.view;

import com.shopping_assistant.model.Shop;
import com.shopping_assistant.model.ShopController;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class ShopView extends Activity {
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.shop_details_view);
        
        Bundle bundle = getIntent().getExtras();
        Shop shop = ShopController.getInstance().findShopByLocation(bundle.getDouble("latitude"),bundle.getDouble("longitude"));
        
        TextView shopName = (TextView) findViewById(R.id.shopName);
        shopName.setText(shop.getName());
        
        TextView shopAddress = (TextView) findViewById(R.id.shopAddress);
        shopAddress.setText(shop.getAddress());
        
        TextView shopPhone = (TextView) findViewById(R.id.shopPhone);
        shopPhone.setText(shop.getPhone());
        
        TextView shopDescription = (TextView) findViewById(R.id.shopDescription);
        shopDescription.setText(shop.getDescription());
        
        TextView shopOpensAt = (TextView) findViewById(R.id.shopOpensAt);
        shopOpensAt.setText(shop.getOpen().toString());
        
        TextView shopClosesAt = (TextView) findViewById(R.id.shopClosesAt);
        shopClosesAt.setText(shop.getClose().toString());
        
        TextView shopHomepage = (TextView) findViewById(R.id.shopHomepage);
        shopHomepage.setText(shop.getHomepage());
        
    }
	
}
